% gaussian mutation operation
function result = gaussian_mutation(ith_seed)
global dimension;
global upper_bound;
global lower_bound;

% initialize the location of the mutation spark
ith_mutation = ith_seed;
% select z dimension
z = round(dimension * rand);
random_dimension_collection = randi([1, dimension], 1, z);

% calculate the coefficient of gaussian explosion
g = normrnd(1,1);

for i = 1:length(random_dimension_collection)
    % mutation 
    ith_mutation(random_dimension_collection(i)) = ith_mutation(random_dimension_collection(i)) * g;
    
    % boundary checking
    if (ith_mutation(random_dimension_collection(i)) < lower_bound) || ...
            (ith_mutation(random_dimension_collection(i)) > upper_bound)
        ith_mutation(random_dimension_collection(i)) = lower_bound + ...
            rem(ith_mutation(random_dimension_collection(i)), (upper_bound - lower_bound)); 
    end
end

result = ith_mutation;

end